-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📦 Declare mas as a Swift Package #350
Conversation
015847d
to
e8ca54c
Compare
The new home is in |
Will a new version be released once this & #352 are merged? Some apps are not being upgraded by |
@rgoldberg, I hope so. I have some other proposals (#346 (comment), #344 (comment), #309 (comment)) in the works, but none of them should prevent this PR and the previous ones from being released. |
Cool. Best to release everything that's almost ready ASAP, instead of delaying those things for new PRs. |
@rgoldberg, you're a member of the mas-cli organization. Are you available to review this PR? |
@rgoldberg @chris-araman FYI the 3 of us are the only active members of the mas-cli org. I would like to get a release out soon and think we're still looking at a patch release (1.8.2) with bug fixes and (many great) project improvements. One piece that I haven't figured out yet is what to do about the hosting for the bottle files for our custom homebrew-tap since Bintray has been shutdown. This shouldn't block the release. |
Unfortunately, I know almost nothing about Xcode, Swift, Apple APIs, etc. I'm a JVM developer. The I know nothing about standard Apple project structures, SPMs, Frameworks, etc., so I don't have the requisite knowledge to review this. I'd happily review it, if I were qualified. I can, however, tinker around to investigate the few issues I've run into, and try to fix them, when it's more of straight ahead programming rather than knowing the ins & outs of the whole Apple ecosystem / platform. Sorry. Wish I could be more help. |
No worries, @rgoldberg! Any help is very appreciated! You are welcome to propose changes even if you're not sure if the code is right. @chris-araman and I can help with suggestions. Or, we work out the Swift and lower level stuff with your input on testing and reproducing issues. |
It looks like Homebrew has migrated to GitHub Packages. Perhaps we should too? I've opened mas-cli/homebrew-tap#19 for tracking. |
👍🏻 My thoughts exactly 😉 |
@chris-araman I'm re-reviewing this PR so we can merge today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work! I love seeing deletes since they are removing cruft.
I found one issue with the version
command that I'd like you to look into.
carthage
andmake
.Sources
andTests
as is the default in new Swift packages.Package.swift
.Package.swift
.swift build
andswift test
succeed.swift build
andswift test
. These continue to build universal (fat, arm64 and x86_64) binaries for macOS 10.11 and later. In the future, we could build for one architecture or the other, and have platform-specific bottles as many other formulae do.To Do:
Decide whether we want to remove the Xcode project and addswift package generate-xcodeproj
toscript/bootstrap
instead. This would allow us to avoid maintaining multiple ways of buildingmas
, and keeping duplicate dependency lists. The build scripts are still building the Xcode project instead of the Swift Package.It turns out that
generate-xcodeproj
is deprecated and unnecessary. Xcode can open themas
directory directly because it's now a Swift Package.Decide if it's okay to linkMasKit
as a library intomas
instead of deploying it as a framework. SPM does not yet support building frameworks, only libraries and executables.I'm moving forward with the assumption that treating this as an SPM library is fine moving forward. If Apple decides in the future to add support for frameworks, we can add a corresponding product or target to
Package.swift
. Themas
binary can now be relocated (Allow running mas as portable or installing it #326). The Homebrew bottles are now much smaller.Decide if we want to keep ourInfo.plist
. SPM does not have a supported way to process and inject these, though we could probably manage to write some.linkerSettings(.unsafeFlags(...))
hackery that would get the job done. It looks like we only inject copyright and version strings. Theversion
command currently uses the injected version string. We could inject that in a different way.I've added logic to
script/version
to generateSources/MasKit/Package.swift
with a string constantPackage.Version
. TheVersionCommand
now emits this constant instead ofCFBundleShortVersionString
. The copyright still exists inLICENSE
, though not in the compiled binary. Should I add acopyright
command or emit the copyright info fromhelp
?Resolve the GitHub Action test failures.Fix themas.pkg
build.Fixes #326.